import React, {Component} from 'react';
import {Row, Col, Button, Layout, Content, Sider} from 'antd';
import Progress from './progress';
const ipcRenderer = require('electron').ipcRenderer;

class TK extends Component {
    constructor() {
        super();
        this.state = {
            visible: true,
            ad: "mm_26907946_16738538_61990383"
        };
    }

    componentDidMount() {

    }

    componentDidUpdate() {

    }

    //打开登录窗口
    openWindow() {
        ipcRenderer.send('tkLogin');
    }

    applfCommin() {
        var ob = this;
        let state = ob.state;
        state.visible = !state.visible;
        ob.setState(state);
    }

    test() {
        return (<div>
            <Button type="primary" onClick={this.openWindow.bind(this)}>登录账号</Button>
            <Button type="primary" onClick={this.applfCommin.bind(this)}>测试吧</Button>
            <Progress start={this.state.visible} ad={this.state.ad} ref="child"/>
        </div>)
    }

    render() {
        return (<div>
                <section className="code-box expand" id="components-message-demo-info">

                </section>
            </div>
        );
    }
}
export default TK;